package com.example.springbootdemo.po;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;

import java.util.Date;

/**
 * @Author: ShengXiaJia
 * @Date: 2019/12/4 10:35
 * @Description:
 */
@Data
public class UserInno {

    /**
     * 为空的字段不显示
     */
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private String name;

    /**
     * 字段不显示
     */
    @JsonIgnore
    private String pwd;

    /**
     * 为字段设置别名
     */
    @JsonProperty("moblie")
    private String phone;

    /**
     * 为时间设置格式和时区
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", locale = "zh", timezone = "GMT+8")
    private Date createTime;

    public UserInno(String name, String pwd, String phone, Date createTime) {
        this.name = name;
        this.pwd = pwd;
        this.phone = phone;
        this.createTime = createTime;
    }

}
